package com.company;

public class Main {

    public static void main(String[] args) {
	// write your code here
     new dog().eat();
     new pig().eat();
     new cat().eat();
     new cat().h();
     new pig().heshui();
    }
}
class Yeye{
    public void h(){
        System.out.println("有吃的");
    }
}
class gongyon extends Yeye{
    int money=100;
    protected void eat(){
        System.out.println("吃粮食");
    }
}
class dog extends gongyon{

}

class pig extends gongyon{
     public void heshui(){
         System.out.println("喝水");
     }
}
class cat extends gongyon{

}